home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagg_m.zip / MATH.SWG / 0040_Getting a Square Root.pas < prev    next >
Pascal/Delphi Source File  |  1993-11-02  |  760b  |  25 lines

  1. {
  2. kortemey@rudolf.nscl.msu.edu (Gerd Kortemeyer)
  3.  
  4. >Does anyone have a Turbo Pascal 6.0/7.0 Function that will return the
  5. >square root of a regular 6 Byte Real argument.   I need a faster one than
  6. >the one the comes With TP7.0 because my Program is spending a lot of time
  7. >in it.
  8.  
  9. if you Really need to do fast FP-calculations you should use a coprocessor
  10. (or a 486DX) together With its dataTypes SINGLE, DOUBLE and EXTendED.
  11.  
  12. if you already got a copro and still use Real, that's the worst thing you
  13. can do. In fact using Real With copro is often slower than Without because
  14. the 6 Byte Real always has to be converted into a copro dataType.
  15.  
  16. Now here is what you can Write instead of x:=sqrt(a);
  17. }
  18. Asm
  19.   fld  a
  20.   fsqrt
  21.   fstp x
  22. end;
  23.  
  24.  
  25.